
import request from '@/utils/request'

export function login(data) {
  console.log('login', data)
  return request({
    url: '/api/login/index',
    method: 'post',
    data
  })
}

export function getCode(data) {
  return request({
    url: '/api/login/code',
    method: 'post',
    data
  })
}

export function scanCode(data) {
  return request({
    url: '/api/login/synchro',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/api/account/view',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}

export function userInfo(userid) {
  const data = { userid: userid }
  return request({
    url: '/api/user/infoByUserid',
    method: 'post',
    data
  })
}
